//
//  OrganationApplySubmitView.m
//  ShangHaiTuJI
//
//  Created by xiaoxiangtuji on 2017/10/23.
//  Copyright © 2017年 xiaoxiangtuji. All rights reserved.
//

#import "OrganationApplySubmitView.h"

@implementation OrganationApplySubmitView

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        UIImageView *imageV = [[UIImageView alloc] init];
        imageV.image = [UIImage imageNamed:@"commitchenggong"];
        [self addSubview:imageV];
        [imageV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self.mas_centerX);
            make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(140), scaleTopAndBottom(135)));
            make.top.equalTo(self.mas_top).offset(scaleTopAndBottom(-30));
        }];
        UILabel *titleLabel = [[UILabel alloc] init];
        titleLabel.text = @"提交成功,请等待审核员审核";
        titleLabel.textAlignment = NSTextAlignmentCenter;
        titleLabel.font = [UIFont systemFontOfSize:14];
        titleLabel.textColor = COLOR_HEX(0x121212);
        [self addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(imageV.mas_bottom).offset(scaleTopAndBottom(20));
            make.left.equalTo(self.mas_left).offset(scaleLeftAndRight(0));
            make.centerX.equalTo(self.mas_centerX);
            make.height.mas_equalTo(scaleTopAndBottom(20));
        }];
        UILabel *introLabel = [[UILabel alloc] init];
        introLabel.font = [UIFont systemFontOfSize:12];
        introLabel.textColor = COLOR_HEX(0x999999);
        introLabel.text = @"预计1个工作日内审核完毕，审核结果会已短 信通知到您注册的手机上。";
        introLabel.numberOfLines = 0;
        [self addSubview:introLabel];
        [introLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(titleLabel.mas_bottom).offset(scaleTopAndBottom(10));
            make.left.equalTo(self.mas_left).offset(scaleLeftAndRight(15));
            make.centerX.equalTo(self.mas_centerX);
            make.height.mas_equalTo(scaleTopAndBottom(40));
        }];
        UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [closeBtn setTitle:@"知道了" forState:UIControlStateNormal];
        closeBtn.backgroundColor = COLOR_HEX(0xF9D024);
        [closeBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [closeBtn addTarget:self action:@selector(closeTheView:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:closeBtn];
        [closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(introLabel.mas_bottom).offset(scaleTopAndBottom(25));
            make.width.mas_equalTo(scaleLeftAndRight(118));
            make.centerX.mas_equalTo(self.mas_centerX);
            make.height.mas_equalTo(scaleTopAndBottom(30));
        }];
        closeBtn.layer.cornerRadius = scaleTopAndBottom(15);
        closeBtn.layer.masksToBounds = YES;
    }
    return self;
}
-(void)closeTheView:(UIButton *)btn{
    self.closeBlock();
}
@end
